<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
    <h:body>
        <a4j:status name="btnStatus"
            onstart="#{rich:component('statPane')}.show();"
                    onstop="#{rich:component('statPane')}.hide();"/>
        <rich:popupPanel id="statPane" autosized="true">
            <h:graphicImage value="/resource/images/ai.gif" />
            请稍等...
        </rich:popupPanel>

        <h:form id="emp">
            <rich:panel id="bcPanel" styleClass="content-hight">

                <a4j:commandButton value="刷新" action="#{payBillViewBean.queryCheckViewAllList}">
                    <a4j:ajax status="btnStatus" event="click" render="@form"/>
                </a4j:commandButton>
                <a4j:commandButton value="审核" action="#{payBillViewBean.batchCheck}"
                                   onclick="return confirm('确定审核通过？');"
                                   disabled="#{empty payBillViewBean.viewListModel}">
                    <a4j:ajax status="btnStatus" event="click" render="@form"/>
                </a4j:commandButton>
                <div style="width:100%;overflow:auto">
                    <rich:dataTable id="editTableBill" value="#{payBillViewBean.viewListModel}"
                                    var="explist" rows="15" style=" width:100%;">                        
                        <rich:column style=" text-align:  center;" >
                            <f:facet name="header">
                                选择
                            </f:facet>
                            <h:selectBooleanCheckbox value="#{explist.selected}">
                                <a4j:ajax event="click" execute="@this"/>
                            </h:selectBooleanCheckbox>
                        </rich:column>
                        <rich:column style=" text-align:  center;" >
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="单据编号"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:commandLink action="#{payBillViewBean.selectedFromView}" >
                                <h:outputText value="#{explist.number}"/>
                            </h:commandLink>
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="单据类型"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="报销凭单"  rendered="#{explist.voutype == '0'}" style="color:green"/>
                            <h:outputText value="差旅费报销单"  rendered="#{explist.voutype == '1'}" style="color:blue"/>
                            <h:outputText value="借款单"  rendered="#{explist.voutype == '3'}" style="color:red"/>
                            <h:outputText value="付款申请单"  rendered="#{explist.voutype == '4'}" style="color:blue"/>
                            <h:outputText value="支出证明单"  rendered="#{explist.voutype == '5'}" style="color:blue"/>
                            <h:outputText value="出国差旅费报销单"  rendered="#{explist.voutype == '6'}" style="color:green"/>
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="单据日期"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.numDate}">
                                <f:convertDateTime pattern="yyyy/MM/dd" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="单据状态"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="待审核"  rendered="#{explist.numberStatus == '0'}" style="color:green"/>                            
                        </rich:column>
                        <rich:column sortBy="#{explist.payDept.name}">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="部门"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.payDept.name}"/>
                        </rich:column>
                        <rich:column sortBy="#{explist.feePer.cpsn_name}">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="人员姓名"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.feePer.cpsn_name}"/>
                        </rich:column>

                        <rich:column sortBy="#{explist.project.finName}">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="预算项目"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.project.finName}"/>
                        </rich:column>

                        <rich:column sortBy="#{explist.affair}">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="借款事由"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.affair}"/>
                        </rich:column>

                        <rich:column sortBy="#{explist.total}">
                            <f:facet name="header">
                                <h:panelGroup>
                                    <h:outputText value="借款金额"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:outputText value="#{explist.total}">
                                <f:convertNumber type="number" pattern="#,##0.00"/>
                            </h:outputText>
                        </rich:column>  
                        <f:facet name="footer">
                            <rich:dataScroller id="ds"></rich:dataScroller>
                        </f:facet>
                    </rich:dataTable>
                </div>
            </rich:panel>
        </h:form>
    </h:body>
</html>

